package com.wyh.domain.vo.gfive.treeVo;

import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.ArrayList;
import java.util.List;

@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class TreeNode {
    @ApiModelProperty("节点id")
    private int unique_id;
    @ApiModelProperty(value = "自身id",required = true)
    private Integer id;
    @ApiModelProperty("自身name")
    private String name;
    @ApiModelProperty(value = "type类型说明:organization为组织,gardenArea为园区,houses为楼盘,building为楼栋,cluster为组团,unit为单元,layer为楼层,room为房屋,parkingSpot为停车位",required = true,dataType = "layer")
    private String type; // A, B, C, D
    @ApiModelProperty("父级id")
    private Integer parentId;//父id
    @ApiModelProperty("父节点id")
    private int parentUniqueId; // Default value indicating no parent
    @ApiModelProperty("状态")
    private Integer state;
    @ApiModelProperty("子集")
    private List<TreeNode> children; // 用于存储子节点


    public TreeNode(int unique_id, int id, String name, String type, Integer state) {
        this.unique_id = unique_id;
        this.id = id;
        this.name = name;
        this.type = type;
        this.children = new ArrayList<>();
        this.state = state;
        this.parentUniqueId = -1; // Default value indicating no parent
    }
}
